using System;

namespace NFreeMarker.Template
{
    /**
     * Template model implementation classes should throw this exception if
     * requested data cannot be retrieved.  
     *
     * @version $Id: TemplateModelException.java,v 1.14 2003/04/22 21:03:22 revusky Exp $
     */

    public class TemplateModelException : TemplateException
    {
        /**
         * Constructs a <tt>TemplateModelException</tt> with no
         * specified detail message.
         */

        public TemplateModelException()
            : this(null, null)
        {
        }

        /**
         * Constructs a <tt>TemplateModelException</tt> with the
         * specified detail message.
         *
         * @param description the detail message.
         */

        public TemplateModelException(string description)
            : this(description, null)
        {
        }

        /**
         * Constructs a <tt>TemplateModelException</tt> with the given underlying
         * Exception, but no detail message.
         *
         * @param cause the underlying <code>Exception</code> that caused this
         * exception to be raised
         */

        public TemplateModelException(Exception cause)
            : this(null, cause)
        {
        }

        /**
         * Constructs a TemplateModelException with both a description of the error
         * that occurred and the underlying Exception that caused this exception
         * to be raised.
         *
         * @param description the description of the error that occurred
         * @param cause the underlying <code>Exception</code> that caused this
         * exception to be raised
         */

        public TemplateModelException(string description, Exception cause)
            : base(description, cause, Core.Environment.GetCurrentEnvironment())
        {
        }
    }
}